<html>
<head><meta charset="utf-8"><title>How do I require a feature gate to be enabled? · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20do.20I.20require.20a.20feature.20gate.20to.20be.20enabled.3F.html">How do I require a feature gate to be enabled?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="222741292"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20do%20I%20require%20a%20feature%20gate%20to%20be%20enabled%3F/near/222741292" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20do.20I.20require.20a.20feature.20gate.20to.20be.20enabled.3F.html#222741292">(Jan 14 2021 at 16:21)</a>:</h4>
<p>I see <code>tcx.features()</code>, but that only tells me <em>whether</em> the feature is enabled. How do I require it to be enabled and give an error otherwise?</p>



<a name="222741323"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20do%20I%20require%20a%20feature%20gate%20to%20be%20enabled%3F/near/222741323" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20do.20I.20require.20a.20feature.20gate.20to.20be.20enabled.3F.html#222741323">(Jan 14 2021 at 16:21)</a>:</h4>
<p>the 'x is experimental' message: <a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=3f06148be2d006af47ebfb539a0af408">https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=3f06148be2d006af47ebfb539a0af408</a></p>



<a name="222741565"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20do%20I%20require%20a%20feature%20gate%20to%20be%20enabled%3F/near/222741565" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20do.20I.20require.20a.20feature.20gate.20to.20be.20enabled.3F.html#222741565">(Jan 14 2021 at 16:23)</a>:</h4>
<p>aha, <code>feature_err_issue</code> looks right</p>



<a name="222742651"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20do%20I%20require%20a%20feature%20gate%20to%20be%20enabled%3F/near/222742651" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20do.20I.20require.20a.20feature.20gate.20to.20be.20enabled.3F.html#222742651">(Jan 14 2021 at 16:30)</a>:</h4>
<p>err actually <code>feature_err</code> since this is a language feature</p>



<a name="222742679"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20do%20I%20require%20a%20feature%20gate%20to%20be%20enabled%3F/near/222742679" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20do.20I.20require.20a.20feature.20gate.20to.20be.20enabled.3F.html#222742679">(Jan 14 2021 at 16:30)</a>:</h4>
<p>adding this to the dev-guide</p>



<a name="222742793"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20do%20I%20require%20a%20feature%20gate%20to%20be%20enabled%3F/near/222742793" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20do.20I.20require.20a.20feature.20gate.20to.20be.20enabled.3F.html#222742793">(Jan 14 2021 at 16:31)</a>:</h4>
<p>/me has to rebuild rustc_middle because he was messing with LLVM for <a href="https://github.com/rust-lang/rust/pull/80932/">https://github.com/rust-lang/rust/pull/80932/</a> <span aria-label="face palm" class="emoji emoji-1f926" role="img" title="face palm">:face_palm:</span></p>



<a name="222743244"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20do%20I%20require%20a%20feature%20gate%20to%20be%20enabled%3F/near/222743244" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20do.20I.20require.20a.20feature.20gate.20to.20be.20enabled.3F.html#222743244">(Jan 14 2021 at 16:34)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/How.20do.20I.20require.20a.20feature.20gate.20to.20be.20enabled.3F/near/222742679">said</a>:</p>
<blockquote>
<p>adding this to the dev-guide</p>
</blockquote>
<p><a href="https://github.com/rust-lang/rustc-dev-guide/pull/1022">https://github.com/rust-lang/rustc-dev-guide/pull/1022</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>